<script>
	import initApp from '@/common/appInit.js';
	import openApp from '@/common/openApp.js';
	import checkIsAgree from '@/pages/uni-agree/utils/uni-agree.js';
	export default {
		globalData: {
			searchText: '',
			appVersion: {},
			config: {},
			$i18n: {},
			$t: {},
			tabbar:[]
		},
		onLaunch: function() {
			console.log('App Launch')
			
			this.globalData.$i18n = this.$i18n
			this.globalData.$t = str => this.$t(str)
			this.globalData.tabbar = [
				{
					iconPath: '/static/tabbar/home.png',
					selectedIconPath: '/static/tabbar/home_active.png',
					text: '首页',
					pagePath: '/pages/home/home'
				},
				{
					iconPath: '/static/tabbar/attention.png',
					selectedIconPath: '/static/tabbar/attention_active.png',
					text: '关注',
					count: 2,
					isDot: true,
					pagePath: '/pages/attention/attention'
				},
				{
					iconPath: '/static/tabbar/issue.png',
					selectedIconPath: '/static/tabbar/issue_active.png',
					text: '发布',
					midButton: true,
					pagePath: '/pages/issue/issue'
				},
				{
					iconPath: '/static/tabbar/message.png',
					selectedIconPath: '/static/tabbar/message_active.png',
					text: '消息',
					count: 2,
					isDot: true,
					pagePath: '/pages/message/message'
				},
				{
					iconPath: '/static/tabbar/me.png',
					selectedIconPath: '/static/tabbar/me_active.png',
					text: '我的',
					pagePath: '/pages/ucenter/ucenter'
				}
			];

			initApp();
			
			// #ifdef H5
				openApp() //创建在h5端全局悬浮引导用户下载app的功能
			// #endif
			// #ifdef APP-PLUS
			//checkIsAgree(); APP端暂时先用原生默认生成的。目前，自定义方式启动vue界面时，原生层已经请求了部分权限这并不符合国家的法规
			// #endif

			// #ifdef H5
			// checkIsAgree(); // 默认不开启。目前全球，仅欧盟国家有网页端同意隐私权限的需要。如果需要
			// #endif

			// #ifdef APP-PLUS
			//idfa有需要的用户在应用首次启动时自己获取存储到storage中
			//https://ask.dcloud.net.cn/article/36107
			/*if(~plus.storage.getItem('idfa')){
				plus.device.getInfo({//需要勾选IDFA
					success:function(e){  
						console.log('idfa =  '+JSON.stringify(e.idfa));  
					},
					fail:function(e){
						console.log('getDeviceInfo failed: '+JSON.stringify(e));  
					}  
				});
			}*/
			// #endif
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	/* uview  样式 */
	
	@import "uview-ui/index.scss";
	
	/*每个页面公共css */
	
	/* 引进字体图标 start */
	
	 /* #ifndef APP-NVUE */
		
		@import url("./common/common_css/home/iconfont.css");	
	 
	 /* #endif */
	
	
	/* 引进字体图标 end */
	/* #ifndef APP-NVUE */
	page {
		
		font-size: $lg-main-font-size;
		color: $lg-main-color;
		line-height:  $lg-line-height;
		font-family: $lg-font-family;
		
		background-color:  $lg-bg-color;
	}
	/* #endif */
	
	/*每个页面公共css */
	
	.container-wrap {
		position: absolute;
		top: 0;
		bottom: 0;
		left: 0;
		right: 0;
	
		background-color: $lg-bg-color;
	}
	
	.iconfont {
		font-family: iconfont;
	}
	
	/* vue 页面的字体颜色 */
	
</style>
